package cn.kow.kmall.common.enums;

import cn.kow.kmall.core.response.BaseResultInfo;

/**
 * @Author: lijun
 * @Description:
 * @Date: Created in 2019-05-20 16:52
 * @Modified By:
 */
public enum KmallResultEnum implements BaseResultInfo {


    PARAM_ERROR(400,"参数验证失败!"),
    KEY_ERROR(400,"密钥验证失败!"),
    SYSTEM_ERROR(400,"系統错误"),
    UNAUTHORIZED(401,"未登录授权"),
    DAO_ERROR(400,"数据查询失败"),
    DAO_NOT_FOUND(404,"数据不存在"),
    IMAGE_UPLOAD_ERROR(400,"图片上传失败"),
    PERMISSION_ERROR(400, "权限不足，拒绝访问"),

    LOGIN_FAIL(10000001,"登录失败"),
    USER_NOT_FIND(10000001,"用户不存在"),
    ITEM_NOT_FIND(10000001,"商品不存在"),

    CART_ADD_LIMIT(3000001, "购物车商品添加超过限制"),


    ADDRESS_ADD_ERROR(4000001, "地址新增失败"),
    ADDRESS_UPDATE_ERROR(4000002, "地址修改失败"),
    ADDRESS_DELETE_ERROR(4000003, "地址删除失败"),
    ADDRESS_NOT_FOUND(4000004, "地址不存在"),
    ADDRESS_ADD_LIMIT(4000005, "地址新增失败，超过限制20条"),

    ORDER_CREATE_ERROR(5001, "订单创建失败"),
    ORDER_NOT_EXIST(5002, "订单不存在"),
    ORDER_STATUS_ERROR(5003, "订单状态错误"),
    ORDER_AMOUNT_ERROR(5004, "订单金额错误"),
    ORDER_CANCEL_FAIL(5005,"订单取消失败"),
    ORDER_EVALUATE_FAIL(5006,"订单评价失败"),
    ORDER_REFUND_FAIL(5007, "订单退款失败"),
    ORDER_UPDATE_ERROR(5007, "订单退款失败"),
    ORDER_SERVICE_CREATE_ERROR(5008, "服务订单创建失败"),
    ORDER_PRODUCT_CREATE_ERROR(5009, "订单商品创建失败"),
    ORDER_REFUND_UPDATE_ERROR(5010, "退款单更新失败"),
    ORDER_DELIVERY_CREATE_ERROR(05011, "配送单创建失败"),
    ORDER_DELIVERY_UPDATE_ERROR(05011, "配送单更新失败"),

    // 支付
    PAY_NOTIFY_FAIL(6001, "微信支付异步通知失败"),
    PAY_FAIL(6002, "支付失败"),
    ACCOUNT_UPDATE_FAIL(6003, "账户修改失败"),

    // 微信
    WX_ACCESS_TOKEN_ERROR(12001, "access_token获取失败，errcode={0}， errmsg={1}"),
    WX_WXACODE_ERROR(12002, "获取小程序码失败，errcode={0}， errmsg={1}"),
    WXC_LOGIN_FAIL(1001, "微信小程序登录失败"),
    WXC_DECRYPT_FAIL(1001, "微信解密失败"),

    MENU_ADD_CODE_ERROR(100, "菜单新增失败，菜单编码错误"),
    USER_ADD_ERROR(001,"创建用户失败，{0}"),
    ;


    private Integer code;

    private String message;

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    KmallResultEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
